# -*- coding: utf-8 -*- 
# @Time : 2021/6/16 15:41 
# @Author : Orange
# @File : __init__.py.py

# -*- coding: utf-8 -*-
from .algorithm import call
from .trainer import train

BIGDATA_DOMAIN = 'http://bigdata-platapi.fnwintranet.com'
BIGDATA_USERKEY = "a95c34cf34deb5a2d0af84f3aea2a616_algorithm-engine-flask"


def get_day_data(deviceId, systemCode, d_name):
    d = {
        "calcInstenceParams": [{
            "calcCode": "DURHovVphAD",
            "deviceId": "METE_METE01",
            "systemCode": "PARK801_EMS01"
        }],
        "check": False,
        "startTime": "2021-05-12 00:00:00",
        "endTime": "2021-05-12 23:59:59",
        "timeType": "day",
        "userKey": "7b4f251ba5743a1e49639ca715641225_energyoverview-release"
    }
    url = BIGDATA_DOMAIN + '/internal/bigdata/calculation/get_result'
    r = requests.post(url, json=d)
    return r.json()
